Object is invalid or not set (Error 40011)

The program called a method or operation on an object that has been closed, discarded, or not allocated.

To avoid this error, make sure: